home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Sample Code / Snippets / Development Tools & Languages / DumpSRec / DumpSRec ReadMe next >
Encoding:
Text File  |  1993-01-18  |  4.9 KB  |  109 lines  |  [TEXT/MPS ]

  1.  
  2. DumpSRec -- an MPW Tool
  3.  
  4. Written by Craig Prouse of Apple Developer Technical Support
  5. Special thanks to C.K. Haun for the original Commando interface!
  6. Copyright © 1990-91, Apple Computer, Inc. -- ALL RIGHTS RESERVED
  7.  
  8. This tool converts an arbitrary Macintosh data file or resource into
  9. Motorola S-Record format, most likely to assist in downloading code
  10. and data to EPROM programmers or non-Macintosh target platforms.
  11.  
  12. Command line syntax:
  13.  
  14. DumpSRec        # write resource or data in S-Record format
  15. DumpSRec [option…] fileName  > dump ≥ progress
  16.     -a addr                    # dump to hexadecimal target address (default = 0)
  17.     -b count                # include count data bytes per record (default = 32)
  18.     -h                        # suppress S0 header record
  19.     -nh                        # specify new data for the S0 header record
  20.     -rt type[=id]            # dump resource with this type and id (default is data fork)
  21.     -s1                        # generate S1 records, 2-byte addresses (default)
  22.     -s2                        # generate S2 records, 3-byte addresses
  23.     -s3                        # generate S3 records, 4-byte addresses
  24.     -x addr                    # hexadecimal target execution address (default = 0)
  25.  
  26.  
  27.         
  28.  
  29. NOTES 1.0d1 -- 9/20/90
  30. ======================
  31.  
  32. This is a development version MPW tool created in response to the requests by a number
  33. of Apple developers for just such a tool. It can take just about any Macintosh file,
  34. data or resource, and dump the contents in Motorola S-Record format. Currently, this
  35. tool dumps its output to standard output. Since the goal is typically to send the
  36. data to another platform, you will need either a communications program to send the
  37. resulting ASCII file, or another MPW tool which takes standard input and routes it
  38. directly to the Serial Driver. This solution could take the form of:
  39.  
  40.     DumpSRec [option…] fileName | Stdin2Serial [maybe another option…]
  41.  
  42. Unfortunately, I don't have the time or motivation to write Stdin2Serial right now.
  43.  
  44. DumpSRec should be pretty stable, but all feedback is welcome. In particular, let me
  45. know how you'd like to see the S0 header option implemented. Currently, the default is
  46. to generate an S0 record based on the contents of SHDR resource 0, which looks like:
  47.  
  48.     Address        2 bytes            typically 0
  49.     Count        2 bytes            count of following data, should be ≤ 252
  50.     Data        (Count) bytes    user-defined data for the S0 record
  51.  
  52. I'd really like a better solution to this, but this was the best I could come up with
  53. for now. One known problem is this: if you edit the SHDR resource with MPW open after
  54. using DumpSRec at least once, subsequent invocations of DumpSRec may not recognize
  55. that the resource has been changed. I think this is a problem with a stale resource
  56. map, but I don't have the energy to track it down and I don't like this solution in
  57. the first place. Suggestions anyone?
  58.  
  59. I intend to release the source code to this tool as a DTS sample when all the bugs
  60. are out of it, so the sooner I get good input, the sooner everyone gets a better
  61. MPW Tool example.
  62.  
  63.  
  64.  
  65. NOTES 1.0d2 -- 10/30/90
  66. ======================
  67.  
  68. Version 1.0d2 improves on a few shortfalls of the previous version. Changes include a
  69. few minor bug fixes and a couple of enhancements. Most importantly, DumpSRec now has
  70. a dialog for entry of the S0 header (convenient for ASCII data, at least). I think
  71. you will find this much superior to the previous strategy of editing the tool itself
  72. with ResEdit. The dialog can be invoked by adding the new command-line option -nh.
  73.  
  74. Furthermore, the last specified header is stored in a preferences file in the System
  75. Folder and will be used for subsequent dumps unless suppressed by the -h option. If
  76. it is necessary to edit the header resource directly, to represent binary data for
  77. instance, it is better to edit the 'SHDR' resource in the preferences file than to
  78. edit the DumpSRec tool directly.
  79.  
  80. Under System 7.0, DumpSRec will properly put its preferences file in the appropriate
  81. subfolder of the System Folder.
  82.  
  83. I've significantly rearranged the Commando dialog, looking for a more logical layout.
  84. I think the current look is more attractive. There are a couple of new items in the
  85. dialog as well. One (bytes per line) was inadvertantly omitted from version d1, and
  86. the other represents the new -nh option.
  87.  
  88. Other changes include slight improvements in some of the error messages and checks to
  89. insure that no header will be generated unless data is actually going to follow.
  90.  
  91.  
  92.  
  93. NOTES 1.0d3 -- 6/3/91
  94. ======================
  95.  
  96. This version is functionally identical to 1.0d2. The main changes were in order to
  97. make the source compile under the final version of MPW 3.2. It is now simpler to test
  98. for presence of FSSpec calls, and FindFolder is a given. A window centering routine was
  99. gratutitously updated with a newer version, since I happened to have it available, and a
  100. number of unnecessary constants and globals were removed.
  101.  
  102. The main reason for all of this is so I can actually follow through on my promise and
  103. release the source code. It's now as ready as it's going to be.
  104.  
  105.  
  106.  
  107. Craig Prouse
  108. AppleLink: MACDTS
  109.